package org.anderground.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * @author Eldar Abusalimov
 */
public class FirstRunActivity extends Activity {

	/**
	 * It checks if the app has been set up after its installation. If so,
	 * returns true. If not, starts an activity to do initial setup and returns
	 * false. If this function returns false the caller should immediately
	 * return from its onCreate method. The calling activity will later be
	 * restarted (using a copy of its original intent) once the application
	 * setup completes.
	 * 
	 * @param activity
	 *            The calling activity.
	 * @return true if the application has already been set up successfully, or
	 *         false the application has been run for the first time and needs
	 *         to be set up.
	 */
	public static boolean ensureSetup(Activity activity) {
		Intent intent = PreconditionActivityHelper.createPreconditionIntent(
				activity, FirstRunActivity.class);
		if (true) {
			return true;
		}
		PreconditionActivityHelper.startPreconditionActivityAndFinish(activity,
				intent);
		return false;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

}
